package com.z.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.z.admin.dao.BlogTagsMapper;
import com.z.admin.entity.BlogTags;
import com.z.admin.service.IBlogTagsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author z
 * @since 2022-04-11
 */
@Service
public class BlogTagsServiceImpl extends ServiceImpl<BlogTagsMapper, BlogTags> implements IBlogTagsService {

    @Resource
    private BlogTagsMapper blogTagsMapper;
    @Resource
    private BlogTagsServiceImpl blogTagsService;

    @Override
    @Transactional
    public void test() {
        BlogTags blogTags = new BlogTags();
        blogTags.setBlogsId(1L);
        blogTags.setTagsId(1L);
        blogTagsMapper.insert(blogTags);
        blogTagsMapper.selectCount(new QueryWrapper<>());
            test1(0);

    }

    private void test1(int a){
        test2(a);
    }
    private void test2(int a){
        BlogTags blogTags = new BlogTags();
        blogTags.setBlogsId(2L);
        blogTags.setTagsId(2L);
        blogTagsMapper.insert(blogTags);
        blogTagsMapper.selectList(new QueryWrapper<>());
        a = 1/a;
    }
}
